home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Microsoft Multimedia Viewer How-To CD
/
Microsoft Multimedia Viewer How-To CD.iso
/
viewerht
/
addons
/
mvvbx
/
mvspy.frm
< prev
next >
Wrap
Text File
|
1993-08-16
|
8KB
|
276 lines
VERSION 2.00
Begin Form Form1
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "Viewer Message Spy"
ClientHeight = 3300
ClientLeft = 945
ClientTop = 1650
ClientWidth = 7290
FillColor = &H00C0C0C0&
Height = 3930
Left = 915
LinkTopic = "Form1"
ScaleHeight = 3300
ScaleWidth = 7290
Top = 1050
Width = 7350
Begin Frame Frame3
BackColor = &H00C0C0C0&
Caption = "Command Line"
Height = 675
Left = 105
TabIndex = 4
Top = 2505
Width = 6990
Begin CommandButton Command1
Caption = "Run"
Height = 285
Left = 5835
TabIndex = 6
Top = 270
Width = 1005
End
Begin TextBox VCommand
BackColor = &H00FFFFFF&
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 285
Left = 165
TabIndex = 5
Top = 270
Width = 5685
End
End
Begin Frame Frame2
BackColor = &H00C0C0C0&
Caption = "Messages"
Height = 2400
Left = 2250
TabIndex = 2
Top = 60
Width = 4845
Begin ListBox Messages
BackColor = &H00C0C0C0&
Height = 1980
Left = 90
TabIndex = 3
Top = 300
Width = 4650
End
End
Begin Frame Frame1
BackColor = &H00C0C0C0&
Caption = "Open Titles"
Height = 2385
Left = 105
TabIndex = 0
Top = 60
Width = 2040
Begin ListBox Titles
BackColor = &H00C0C0C0&
Height = 1980
Left = 165
TabIndex = 1
Top = 300
Width = 1740
End
End
Begin MVIEW MV1
BaggageFile = ""
Left = 525
optCmd = 0 'cmdoptNONE
Top = 3210
VGetInfo = 0 'False
VGetInfohWnd = 0
ViewerCommand = ""
ViewerTitle = ""
VInfo = "╘ê∩ "
VInfoMsg = 0 'GI_NOTHING
Vwr = 0
End
Begin CommonDialog CMDialog
Left = 30
Top = 3195
End
Begin Menu File_menu
Caption = "&File"
Begin Menu File_Open
Caption = "Open..."
End
End
End
Sub AddMessage (ByVal myMessage$)
Messages.AddItem myMessage$
Messages.ListIndex = Messages.NewIndex
If Messages.ListCount > 50 Then
Messages.RemoveItem Messages.ListCount - 1
End If
End Sub
Sub File_Open_Click ()
CMDialog.DefaultExt = "MVB"
CMDialog.DialogTitle = "Choose a Viewer File"
CMDialog.Filter = "Viewer File|*.MVB|All|*.*"
CMDialog.Action = 1
MV1.ViewerTitle = CMDialog.Filename
MV1.optCmd = 0
MV1.Vwr = 0
MV1.ViewerCommand = "Prev()"
MV1.ViewerExecute = True
If MV1.Vwr > 0 Then
'
Titles.AddItem CMDialog.Filetitle
Titles.ItemData(Titles.NewIndex) = MV1.Vwr
MV1.ViewerCommand = "RegisterRoutine(`VBMVLINK',`BroadcastMessages',`U')"
MV1.ViewerExecute = True
MV1.ViewerCommand = "BroadcastMessages (hwndApp)"
MV1.ViewerExecute = True
Else
MsgBox "This file could not be opened", 16, "Error!"
End If
End Sub
Function ItemFromVwr (ByVal myvwr)
y = Titles.ListCount - 1
For x = 0 To y
If Titles.ItemData(x) = myvwr Then
ItemFromVwr = x
GoTo allDone2
End If
Next x
ItemFromVwr = -1
allDone2:
End Function
Sub MV1_Activate (Vwr As Integer, Gotfocus As Long)
M$ = NameFromVwr$(Vwr) + ":Activate"
If Gotfocus = 0 Then
Q$ = " Losing Focus"
Else
Q$ = " Gaining Focus"
End If
AddMessage M$ + Q$
End Sub
Sub MV1_ActivateWin (Vwr As Integer, WinState As Long, WhichWindow As Long)
M$ = NameFromVwr$(Vwr) + ":ActivateWin"
AddMessage M$
If WinState = 0 Then
Q1$ = " Deactivating "
Else
Q1$ = " Activating "
End If
If WinState = 0 Then
Q2$ = " Main Window"
Else
Q2$ = " Secondary Window"
End If
AddMessage M$ + Q1$ + Q2$
End Sub
Sub MV1_ChgFile (Vwr As Integer, MVBFileName$, SecondaryWindow As Long)
M$ = NameFromVwr$(Vwr) + ":ChgFile"
If SecondaryWindow = 0 Then
Q1$ = " Main Window from "
Else
Q1$ = " Secondary Window from "
End If
AddMessage M$ + Q1$ + MVBFileName$
End Sub
Sub MV1_EndConfig (Vwr As Integer, SecondaryWindow As Long)
M$ = NameFromVwr$(Vwr) + ":EndConfig"
If SecondaryWindow = 0 Then
Q1$ = " Main Window from "
Else
Q1$ = " Secondary Window from "
End If
AddMessage M$ + Q1$
End Sub
Sub MV1_EndJump (Vwr As Integer, TopicAddress As Long, ScrollPosition As Long)
M$ = NameFromVwr$(Vwr) + ":EndJump "
AddMessage M$ + "Topic # " + Format$(TopicAddress) + " Scroll " + Format$(ScrollPosition)
End Sub
Sub MV1_Init (Vwr As Integer, hViewerInst As Long)
M$ = NameFromVwr$(Vwr) + ":Init"
AddMessage M$ + " hInst=" + Format$(hViewerInst)
End Sub
Sub MV1_MinMax (Vwr As Integer, MinMaxState As Long)
M$ = NameFromVwr$(Vwr) + ":MinMax"
If MinMaxState = 1 Then
Q1$ = " Minimized"
Else
Q1$ = " Maximized"
End If
AddMessage M$ + Q1$
End Sub
Sub MV1_Scroll (Vwr As Integer, TopicAddress As Long, ScrollPosition As Long)
M$ = NameFromVwr$(Vwr) + ":Scroll"
AddMessage M$ + "Topic # " + Format$(TopicAddress) + " Scroll " + Format$(ScrollPosition)
End Sub
Sub MV1_Size (Vwr As Integer, iWidth As Long, iHeight As Long)
M$ = NameFromVwr$(Vwr) + ":Size"
AddMessage M$ + " W= " + Format$(iHeight) + " H= " + Format$(iHeight)
End Sub
Sub MV1_StartConfig (Vwr As Integer, SecondaryWindow As Long)
M$ = NameFromVwr$(Vwr) + ":StartConfig"
If SecondaryWindow = 0 Then
Q1$ = " Main Window from "
Else
Q1$ = " Secondary Window from "
End If
AddMessage M$ + Q1$
End Sub
Sub MV1_StartJump (Vwr As Integer, TopicAddress As Long, ScrollPosition As Long)
M$ = NameFromVwr$(Vwr) + ":StartJump"
AddMessage M$ + "Topic # " + Format$(TopicAddress) + " Scroll " + Format$(ScrollPosition)
End Sub
Sub MV1_Term (Vwr As Integer, hViewerInst As Long)
M$ = NameFromVwr$(Vwr) + ":Terminate"
AddMessage M$
If Vwr > 0 Then Titles.RemoveItem ItemFromVwr(Vwr)
End Sub
Function NameFromVwr$ (ByVal myvwr%)
y = Titles.ListCount - 1
For x = 0 To y
If Titles.ItemData(x) = myvwr% Then
NameFromVwr$ = Titles.List(x)
GoTo alldone1
End If
Next x
NameFromVwr$ = "Non-Viewer"
alldone1:
End Function
Function VwrFromItem (ByVal ItemNum)
VwrFromItem = Titles.ItemData(ItemNum)
End Function